load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//tests:bazel_tests.bzl", "bazel_test")

bazel_test(
    name = "trans_dep_error",
    check = """
if [ "$result" -eq 0 ]; then
  echo "error: build succeeded unexpectedly" >&2
  result=1
else
  result=0
fi
""",
    command = "build",
    targets = [":go_default_library"],
)

go_library(
    name = "go_default_library",
    srcs = ["lib.go"],
    importpath = "github.com/bazelbuild/rules_go/tests/trans_dep_error",
    tags = ["manual"],
    deps = [":a"],
)

go_library(
    name = "a",
    srcs = ["a.go"],
    importpath = "github.com/bazelbuild/rules_go/tests/trans_dep_error/a",
    deps = [":b"],
)

go_library(
    name = "b",
    srcs = ["b.go"],
    importpath = "github.com/bazelbuild/rules_go/tests/trans_dep_error/b",
)
